package com.pmt.feedplayer.ui

import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import com.pmt.feedplayer.data.VideoItem
import com.pmt.feedplayer.data.VideoListState

/**
 * 视频列表组件接口
 */
@Composable
expect fun VideoFeed(
    videos: VideoListState,
    onVideoClick: (VideoItem) -> Unit,
    onLoadMore: () -> Unit
)

/**
 * 单个视频项组件接口
 */
@Composable
expect fun VideoItem(video: VideoItem, onClick: () -> Unit)

/**
 * 格式化观看次数
 */
fun formatViewCount(count: Int): String {
    return when {
        count >= 1000000 -> "${count / 1000000}M"
        count >= 1000 -> "${count / 1000}K"
        else -> count.toString()
    }
}